package cn.good.yan.controller;


import cn.good.yan.feign.PaymentFeignService;
import cn.good.yan.pojo.Bill;
import cn.good.yan.pojo.CommonResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * 演示 - 客户端
 * 1. 模拟客户端 请求 服务端 ，使用 OpenFeign调用

 * @author shengren.yan
 * @create 2023-09-20
 */
@Slf4j
@RestController
@RequestMapping("/k1")
public class OrderController {

    // Feign 接口
    @Resource
    private PaymentFeignService paymentFeignService;

    @GetMapping(value = "/test/get/{id}")
    public CommonResult<List<Bill>> getPaymentById(@PathVariable("id") Long id) {
        return paymentFeignService.getPaymentById(id);
    }


}

